]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
windowManager: Take over <super>m keybinding to toggle calendar
authorFlorian Müllner <fmuellner@gnome.org>
Wed, 18 Feb 2015 01:52:07 +0000 (02:52 +0100)
committerFlorian Müllner <fmuellner@gnome.org>
Fri, 20 Feb 2015 16:39:59 +0000 (17:39 +0100)
It's where all the fun is happening nowadays ...

https://bugzilla.gnome.org/show_bug.cgi?id=744850

data/50-gnome-shell-system.xml.in
js/ui/messageTray.js
js/ui/panel.js
js/ui/windowManager.js

index 3e8c6f847bf197a48ba2f0ede9f4985570381fac..60f456c8d5a9098936b08c1f0c228ba2ff0a8097 100644 (file)
@@ -6,7 +6,7 @@
                 package="gnome-shell">
 
        <KeyListEntry name="toggle-message-tray"
-                      _description="Show the message tray"/>
+                      _description="Show the message list"/>
 
        <KeyListEntry name="focus-active-notification"
                       _description="Focus the active notification"/>
index 012972c51524682b45cc2dbac3e30f58be64ed08..8a85944712020b22d100269672bf89b97ffd864c 100644 (file)
@@ -1703,13 +1703,6 @@ const MessageTray = new Lang.Class({
 
         Main.sessionMode.connect('updated', Lang.bind(this, this._sessionUpdated));
 
-        Main.wm.addKeybinding('toggle-message-tray',
-                              new Gio.Settings({ schema_id: SHELL_KEYBINDINGS_SCHEMA }),
-                              Meta.KeyBindingFlags.NONE,
-                              Shell.ActionMode.NORMAL |
-                              Shell.ActionMode.MESSAGE_TRAY |
-                              Shell.ActionMode.OVERVIEW,
-                              Lang.bind(this, this.toggleAndNavigate));
         Main.wm.addKeybinding('focus-active-notification',
                               new Gio.Settings({ schema_id: SHELL_KEYBINDINGS_SCHEMA }),
                               Meta.KeyBindingFlags.NONE,
index df67e2bf1929ebcaa1a19b37ae1e3283e8787278..6e4fee3eaf7c0921968b820190a44700cdb4402b 100644 (file)
@@ -877,9 +877,8 @@ const Panel = new Lang.Class({
         return Clutter.EVENT_STOP;
     },
 
-    toggleAppMenu: function() {
-        let indicator = this.statusArea.appMenu;
-        if (!indicator) // appMenu not supported by current session mode
+    _toggleMenu: function(indicator) {
+        if (!indicator) // menu not supported by current session mode
             return;
 
         let menu = indicator.menu;
@@ -891,6 +890,14 @@ const Panel = new Lang.Class({
             menu.actor.navigate_focus(null, Gtk.DirectionType.TAB_FORWARD, false);
     },
 
+    toggleAppMenu: function() {
+        this._toggleMenu(this.statusArea.appMenu);
+    },
+
+    toggleCalendar: function() {
+        this._toggleMenu(this.statusArea.dateMenu);
+    },
+
     closeCalendar: function() {
         let indicator = this.statusArea.dateMenu;
         if (!indicator) // calendar not supported by current session mode
index 1319fbbef85ba50563e901bca0fc915093368a5a..b4395c143b630c51c4f12bae7b4c6a089ef63ab1 100644 (file)
@@ -834,6 +834,13 @@ const WindowManager = new Lang.Class({
                            Shell.ActionMode.TOPBAR_POPUP,
                            Lang.bind(this, this._toggleAppMenu));
 
+        this.addKeybinding('toggle-message-tray',
+                           new Gio.Settings({ schema_id: SHELL_KEYBINDINGS_SCHEMA }),
+                           Meta.KeyBindingFlags.NONE,
+                           Shell.ActionMode.NORMAL |
+                           Shell.ActionMode.TOPBAR_POPUP,
+                           Lang.bind(this, this._toggleCalendar));
+
         global.display.connect('show-resize-popup', Lang.bind(this, this._showResizePopup));
 
         Main.overview.connect('showing', Lang.bind(this, function() {
@@ -1514,6 +1521,10 @@ const WindowManager = new Lang.Class({
         Main.panel.toggleAppMenu();
     },
 
+    _toggleCalendar: function(display, screen, window, event, binding) {
+        Main.panel.toggleCalendar();
+    },
+
     _toggleTweens: function() {
         this._tweensPaused = !this._tweensPaused;
         const OrigTweener = imports.tweener.tweener;